<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Register</title>
</head>
<body>
	<h1>Welcome:${user.name }</h1>
	<form action="update" method="post">
		Store: <select name="store">
			<c:forEach items="${stores }" var="store">
				<c:choose>
					<c:when test="${p.sid == store.sid }">
						<option value="${store.sid }" selected="selected">${store.address }</option>
					</c:when>
					<c:otherwise>
						<option value="${store.sid }">${store.address }</option>
					</c:otherwise>
				</c:choose>
			</c:forEach>
		</select><br>
		<input type="hidden" name="pid" value="${p.pid }">
		Name: <input type="text" name="name" value="${p.name }"><br>
		Price: <input type="text" name="price" value="${p.price }"><br>
		Total: <input type="number" name="total" value="${p.total }"><br>
		Production date: <input type="date" name="pd" value='<fmt:formatDate value="${p.pd}" pattern="yyyy-MM-dd"/>'><br>
		<input type="submit" value="Submit">
	</form>
	
</body>
</html>